﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace svcutil2
{
    public class Utils
    {
        public static void RunExe(string path, string[] args)
        {
            var startInfo = new ProcessStartInfo();
            startInfo.FileName = path;
            startInfo.Arguments = @"""" + String.Join(@""" """, args) + @"""";
            startInfo.RedirectStandardOutput = true;
            startInfo.UseShellExecute = false;            
            var p = Process.Start(startInfo);            
            p.WaitForExit();

            var log = p.StandardOutput.ReadToEnd();
            Console.WriteLine();
            Console.WriteLine(log);
        }
    }
}
